package com.ruoyi.lhb.service.impl;

import java.util.List;

import com.ruoyi.lhb.domain.Ordertime;
import com.ruoyi.system.domain.SysUserRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lhb.mapper.OrdertimeMapper;
import com.ruoyi.lhb.service.IOrdertimeService;

/**
 * 排班Service业务层处理
 *
 * @author lhb
 * @date 2022-09-27
 */
@Service
public class OrdertimeServiceImpl implements IOrdertimeService
{
    @Autowired
    private OrdertimeMapper ordertimeMapper;

    /**
     * 查询排班
     *
     * @param otid 排班主键
     * @return 排班
     */
    @Override
    public Ordertime selectOrdertimeByOtid(Long otid)
    {
        return ordertimeMapper.selectOrdertimeByOtid(otid);
    }

    /**
     * 查询排班列表
     *
     * @param ordertime 排班
     * @return 排班
     */
    @Override
    public List<Ordertime> selectOrdertimeList(Ordertime ordertime)
    {
        return ordertimeMapper.selectOrdertimeList(ordertime);
    }

    /**
     * 新增排班
     *
     * @param ordertime 排班
     * @return 结果
     */
    @Override
    public int insertOrdertime(Ordertime ordertime)
    {
        return ordertimeMapper.insertOrdertime(ordertime);
    }

    /**
     * 修改排班
     *
     * @param ordertime 排班
     * @return 结果
     */
    @Override
    public int updateOrdertime(Ordertime ordertime)
    {
        return ordertimeMapper.updateOrdertime(ordertime);
    }

    /**
     * 批量删除排班
     *
     * @param otids 需要删除的排班主键
     * @return 结果
     */
    @Override
    public int deleteOrdertimeByOtids(Long[] otids)
    {
        return ordertimeMapper.deleteOrdertimeByOtids(otids);
    }

    /**
     * 删除排班信息
     *
     * @param otid 排班主键
     * @return 结果
     */
    @Override
    public int deleteOrdertimeByOtid(Long otid)
    {
        return ordertimeMapper.deleteOrdertimeByOtid(otid);
    }

    @Override
    public int deleteOrdertimeBydate(String date) {
        return ordertimeMapper.deleteOrdertimeBydate(date);
    }

    @Override
    public List<SysUserRole> selectRoleByuserid(Long userId) {
        return ordertimeMapper.selectRoleByuserid(userId);
    }

}
